{template common/contentheader}
<div class="setcontent">
	<div class="settitle">
		<h3>{lang admin_user_group:admin}</h3>{template user/usergroup-submenu}
	</div>
	<div class="alert alert-info mt10">
		<span class="label label-info">{lang info:admin}</span>
		{lang admin_user_group_tip:admin}
	</div>
	<div class="setform">
		<table class="table table-striped">
        <thead>
          <tr>
            <th width="30">ID</th>
            <th width="40">{lang group_name:admin}</th>
            <th width="40">{lang group_key:admin}</th>
			{if $type=='member'}
            <th width="40">{lang group_credits_range:admin}</th>
			{/if}
            <th width="40">{lang group_color:admin}</th>
            <th width="60">{lang operation:admin}</th>
          </tr> 
        </thead>
        <tbody> 
        {loop $groups $key $group}
			<tr>  
			<td>$group['usergroup_id']</td>
			<td>$group['usergroup_name']</td>
			<td>$group['usergroup_key']</td>
			{if $type=='member'}
			<td>{$group['credits_lower']}-{$group['credits_higher']}</td>
			{/if}
			<td><a href="javascript:;" title="$group['color']" style="width:20px;height:20px;background-color: {if $group['color']}$group['color']{else}black{/if};display: block;"></a></td>
			<td>{if $type!='system'}<a href="{url admin/usergroup?act=delete&type=$type&gid=$group['usergroup_id']}">{lang delete:admin}</a>{/if} 
			<a href="{url admin/usergroup?act=edit&type=$type&gid=$group['usergroup_id']}">{lang edit:admin}</a> 
			<a href="{url admin/usergroup?act=permission&type=$type&gid=$group['usergroup_id']}">{lang permission:admin}</a></td>
          	</tr>
		{/loop}
          
        </tbody>
		</table>
		<div class="text_c">$pages</div>
	</div> 
	<div class="settitle">
		<h3>{lang group_add:admin}</h3>
	</div>
	<div class="setform">
		<form class="pzform" method="post" action="{url admin/usergroup?act=add&type=$type}" id="addform">
			
			<div class="formgroup">
				<label class="formlabel">{lang group_name:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="group_name" id="group_name"/>
				</div>
				<span class="formhelp">{lang group_name:admin}</span>
			</div>
			
			<div class="formgroup">
				<label class="formlabel">{lang group_key:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="group_key" id="group_key"/>
				</div>
				<span class="formhelp">{lang group_key_tip:admin}</span>
			</div>
			{if $type=='member'}
			<div class="formgroup">
				<label class="formlabel">{lang group_credits_range:admin}:</label>
				<div class="formcontrol">
					<input type="text" class="small" name="credits_lower" id="credits_lower"/>
					<label>-</label>
					<input type="text" class="small" name="credits_higher" id="credits_higher"/>
				</div>
				<span class="formhelp">{lang group_credits_range:admin}</span>
			</div>
			{/if}
			<div class="formgroup">
				<label class="formlabel">{lang group_color:admin}:</label>
				<div class="formcontrol">
					<input type="text" name="group_color" id="group_color"/>
				</div>
				<span class="formhelp">{lang group_color:admin}</span>
			</div>
			<div class="formbuttons">
				<button type="submit" class="btn btn-primary">{lang add:admin}</button>
			</div>
		</form>
	</div>
</div>
{template common/contentfooter}